#!/usr/bin/python
# -*- coding: utf-8 -*-
import gtk, gobject
import gettext
_ = gettext.gettext
class Message(object):
    
    @staticmethod
    def gioError():
        Message.__error(_('File not found'))
    
    @staticmethod
    def configError():
        Message.__error(_('<b>Remote Download Manager Client</b>\nPlease set the <b>Email</b> address in <b>Config</b> first and press <b>Save</b>.'))
        
    @staticmethod
    def urlValueError():
        Message.__error(_('Url not recognized. Is the url correct?'))

    @staticmethod
    def urlConnectionError():
        Message.__error(_('Url open error. Check out your Internet connection'))
        
    @staticmethod
    def uncaughtError():
        Message.__error(_('Error unexpected.'))
    
    @staticmethod
    def urlAuthError(eMsg):
        Message.__error(_('Url authentication error: ')+str(eMsg))
        
    @staticmethod
    def deleteFileYesNo():
        return Message.__yesNo(_('Should I delete file with link?'))
        
    @staticmethod
    def __error(msg):
        #pass
        msgDialog = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_OK, message_format=None)
        msgDialog.set_markup(msg)
        msgDialog.run()
        msgDialog.destroy()
        del msgDialog

    @staticmethod
    def __yesNo(msg):
        msgDialog = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format=None)
        msgDialog.set_markup(msg)
        resp = msgDialog.run()
        msgDialog.destroy()
        del msgDialog
        return resp
